<template>
  <!-- 输入框显示字数限制 -->
  <view class="limit_comp">
    {{currentNumber}} / {{limitNumber}}
  </view>
</template>

<script>
export default {
  components: {},
  props: {
    text: {
      type: String,
      default: ''
    },
    limitNumber: {
      // 标签列表
      type: Number,
      default: 100
    }
  },
  data() {
    return {
      currentNumber: 0,
    };
  },
  computed: {
  },
  watch:{
    text(value){
      if(value){
        this.currentNumber = value.length
      }else{
        this.currentNumber = 0
      }
    }
  },
  created() {
  },
  methods: {
  }
};
</script>

<style scoped lang="scss">
.limit_comp {
  font-size: 25rpx;
  font-family: SourceHanSansSC-Regular, SourceHanSansSC;
  font-weight: 400;
  color: #A1A1A1;
  line-height: 35rpx;
}
</style>
